from tools import is_factor
import math

value = 600851475143
num = int(math.sqrt(value))
factorlist = []


    
for x in range(2,num+1):
    if is_factor(x):
        factorlist.append(x)
for x in factorlist:
    if value % x == 0:
        max = x
    
print(max)